package org.su.generalmvc.entity;

import java.lang.reflect.Method;

/**
 * 简单对象缓存，用户复合参数类对象保存. 将pojo的写方法预存，方便参数快速注入。
 * 
 * @author yangchuan
 * 
 */
public final class ProtobufCache extends PojoCache{

    private Method build;

    /**
     * protobuf 专用的 builder 子类创建方法
     */
    private Method newBuilder;

    /**
     * 通过byte数组转换为protobuf 对象
     */
    private Method parseFrom;

    public ProtobufCache(){}

    public ProtobufCache(Method build, Method newBuilder, Method parseFrom) {
        this.build = build;
        this.newBuilder = newBuilder;
        this.parseFrom = parseFrom;
    }

    public Method getBuild() {
        return build;
    }

    public void setBuild(Method build) {
        this.build = build;
    }

    public Method getNewBuilder() {
        return newBuilder;
    }

    public void setNewBuilder(Method newBuilder) {
        this.newBuilder = newBuilder;
    }

    public Method getParseFrom() {
        return parseFrom;
    }

    public void setParseFrom(Method parseFrom) {
        this.parseFrom = parseFrom;
    }

}
